﻿<%@ Page Title="Lifeware Mercator2 - TCP/IP Log Monitor" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
    CodeBehind="Default.aspx.cs" Inherits="WebApplication1._Default" %>



<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
    <h2>
        Monitor de pacotes tcp/ip
    </h2>
    <p>

 <style type="text/css">
            
    .styleFixedTable
    {
        table-layout:fixed;
        word-wrap:break-word;
    }
</style>

        <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
            AllowSorting="True" CellPadding="4" 
            DataKeyNames="ID" DataSourceID="MercatorLog" ForeColor="#333333" AutoGenerateColumns="False" 
            onselectedindexchanged="GridView1_SelectedIndexChanged" 
            CssClass="styleFixedTable" Width="100%">
            <AlternatingRowStyle BackColor="White" />
            <Columns>
                <asp:CommandField ShowSelectButton="True" SelectText="Ver mapa" >
                <HeaderStyle Width="5%" />
                </asp:CommandField>
                <asp:BoundField DataField="ID" HeaderText="ID" InsertVisible="False" 
                    ReadOnly="True" SortExpression="ID" Visible="False" />
                <asp:BoundField DataField="Latitude" HeaderText="Latitude" 
                    SortExpression="Latitude" >
                <HeaderStyle HorizontalAlign="Left" Width="7%" />
                </asp:BoundField>
                <asp:BoundField DataField="Longitude" HeaderText="Longitude" 
                    SortExpression="Longitude" >
                <HeaderStyle HorizontalAlign="Left" Width="7%" />
                </asp:BoundField>
                <asp:BoundField DataField="DeviceID" HeaderText="Dispositivo" 
                    SortExpression="DeviceID" Visible="False">
                <HeaderStyle HorizontalAlign="Left" Width="8%" />
                </asp:BoundField>
                <asp:HyperLinkField DataNavigateUrlFields="DeviceID" 
                    DataNavigateUrlFormatString="Device.aspx?ID={0}" DataTextField="DeviceID"
                    
                    HeaderText="Dispositivo">
                <HeaderStyle HorizontalAlign="Left" Width="8%" />
                </asp:HyperLinkField>
                <asp:BoundField DataField="ReceivedBytes" HeaderText="ReceivedBytes" 
                    SortExpression="ReceivedBytes" Visible="False" />
                <asp:BoundField DataField="ReceivedASCII" HeaderText="Bytes" 
                    SortExpression="ReceivedASCII" >
                <HeaderStyle HorizontalAlign="Left" />
                </asp:BoundField>
                <asp:BoundField DataField="ServerIP" HeaderText="Servidor" 
                    SortExpression="ServerIP" >
                <HeaderStyle HorizontalAlign="Left" Width="10%" />
                </asp:BoundField>
                <asp:BoundField DataField="ReceivedDateTime" HeaderText="Data/hora" 
                    SortExpression="ReceivedDateTime" >
                <HeaderStyle HorizontalAlign="Left" Width="7.5%" />
                </asp:BoundField>
                <asp:BoundField DataField="DeviceIP" HeaderText="DeviceIP" 
                    SortExpression="DeviceIP" Visible="False" />
                <asp:BoundField DataField="ReceivedBytes" HeaderText="Texto mensagem" 
                    SortExpression="ReceivedBytes" />
            </Columns>
            <EditRowStyle BackColor="#7C6F57" />
            <FooterStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
            <HeaderStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#666666" ForeColor="White" HorizontalAlign="Center" />
            <RowStyle BackColor="#E3EAEB" />
            <SelectedRowStyle BackColor="#C5BBAF" Font-Bold="True" ForeColor="#333333" />
            <SortedAscendingCellStyle BackColor="#F8FAFA" />
            <SortedAscendingHeaderStyle BackColor="#246B61" />
            <SortedDescendingCellStyle BackColor="#D4DFE1" />
            <SortedDescendingHeaderStyle BackColor="#15524A" />
        </asp:GridView>
        <asp:SqlDataSource ID="MercatorLog" runat="server" 
            ConnectionString="<%$ ConnectionStrings:MERCATOR_histConnectionString %>" 
            
            
            
            
            
            
            SelectCommand="SELECT [ID], [ReceivedDateTime], [ReceivedBytes], [ReceivedASCII], [ServerIP], [DeviceIP], [Latitude], [Longitude], [LatitudeDecimal], [LongitudeDecimal], [Obs], [DeviceID], [DeviceTime], [DeviceDate] FROM [RelayLog] ORDER BY [ReceivedDateTime] DESC">
        </asp:SqlDataSource>
    </p>
    <p>
        &nbsp;</p>
</asp:Content>
